// Read a page's GET URL variables and return them as an associative array.
function getUrlVars() {
	var vars = [], hash;
	var hashes = window.location.href.slice(
			window.location.href.indexOf('?') + 1).split('&');
	for ( var i = 0; i < hashes.length; i++) {
		hash = hashes[i].split('=');
		vars.push(hash[0]);
		vars[hash[0]] = hash[1];
	}
	return vars;
}

function doAction(action, itemId) {
	switch (action) {
	case "changeItem":
		doChangeItem(itemId);
		break;
	case "checkIn":
		doCheckIn(itemId);
		break;
	case "checkOut":
		doCheckOut(itemId);
		break;
	case "changeStore":
		doChangeStore(itemId);
		break;
	case "getItem":
		doGetItem(itemId);
		break;
	}
}

function doGetItem(itemId) {
//
}

$.fx.speeds._default = 500;
$(function() {

	$("#addPriceListForm").dialog({
		autoOpen : false,
		show : "fade",
		hide : "fade",
		close : function() {
			$("#addPriceListForm").empty();
			$("#addPriceListForm").append("Please wait...");
		}
	});

	$("#addPriceListBtn").click(
			function() {
				$("#addPriceListForm").dialog("open");

				$.get("/ladu/api?a=addPriceListForm",
						function(data) {
							$("#addPriceListForm").empty();
							$("#addPriceListForm").append(data);
						});
				return false;
			});
});